home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / g_man / cat3 / OpenGL / glpixeltexgen.z / glpixeltexgen
Encoding:
Text File  |  2002-10-03  |  12.2 KB  |  199 lines

  1.  
  2.  
  3.  
  4. ggggllllPPPPiiiixxxxeeeellllTTTTeeeexxxxGGGGeeeennnnSSSSGGGGIIIIXXXX((((3333GGGG))))          OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee          ggggllllPPPPiiiixxxxeeeellllTTTTeeeexxxxGGGGeeeennnnSSSSGGGGIIIIXXXX((((3333GGGG))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      ggggllllPPPPiiiixxxxeeeellllTTTTeeeexxxxGGGGeeeennnnSSSSGGGGIIIIXXXX - affects the generation of texture coordinates from
  10.      pixel groups
  11.  
  12.  
  13. CCCC SSSSPPPPEEEECCCCIIIIFFFFIIIICCCCAAAATTTTIIIIOOOONNNN
  14.      void ggggllllPPPPiiiixxxxeeeellllTTTTeeeexxxxGGGGeeeennnnSSSSGGGGIIIIXXXX( GLenum _m_o_d_e )
  15.  
  16.  
  17. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  18.      _m_o_d_e  Specifies a mode of generating texture coordinates from pixel
  19.            groups.  Must be one of the following:  GGGGLLLL____NNNNOOOONNNNEEEE, GGGGLLLL____RRRRGGGGBBBBAAAA, GGGGLLLL____RRRRGGGGBBBB,
  20.            GGGGLLLL____AAAALLLLPPPPHHHHAAAA. GGGGLLLL____PPPPIIIIXXXXEEEELLLL____TTTTEEEEXXXX____GGGGEEEENNNN____AAAALLLLPPPPHHHHAAAA____RRRREEEEPPPPLLLLAAAACCCCEEEE____SSSSGGGGIIIIXXXX,
  21.            GGGGLLLL____PPPPIIIIXXXXEEEELLLL____TTTTEEEEXXXX____GGGGEEEENNNN____AAAALLLLPPPPHHHHAAAA____NNNNOOOO____RRRREEEEPPPPLLLLAAAACCCCEEEE____SSSSGGGGIIIIXXXX,
  22.            GGGGLLLL____PPPPIIIIXXXXEEEELLLL____TTTTEEEEXXXX____GGGGEEEENNNN____AAAALLLLPPPPHHHHAAAA____MMMMSSSS____SSSSGGGGIIIIXXXX, or GGGGLLLL____PPPPIIIIXXXXEEEELLLL____TTTTEEEEXXXX____GGGGEEEENNNN____AAAALLLLPPPPHHHHAAAA____LLLLSSSS____SSSSGGGGIIIIXXXX.
  23.            The default value is GGGGLLLL____NNNNOOOONNNNEEEE.
  24.  
  25.  
  26. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  27.      The pixel texgen function is enabled by calling ggggllllEEEEnnnnaaaabbbblllleeee and disabled by
  28.      calling ggggllllDDDDiiiissssaaaabbbblllleeee with GGGGLLLL____PPPPIIIIXXXXEEEELLLL____TTTTEEEEXXXX____GGGGEEEENNNN____SSSSGGGGIIIIXXXX.  Pixel texgen affects the
  29.      result of the ggggllllDDDDrrrraaaawwwwPPPPiiiixxxxeeeellllssss and ggggllllCCCCooooppppyyyyPPPPiiiixxxxeeeellllssss commands.  It allows the
  30.      color components of pixel groups to be used as texture coordinates,
  31.      effectively converting a color image into a texture coordinate image.
  32.      Because texture mapping is essentially a multidimensional table lookup,
  33.      this conversion supports multidimensional color lookups for images.  Such
  34.      multidimensional lookups can be used to implement very accurate color
  35.      space conversions.
  36.  
  37.      When pixel texgen is enabled, the red, green, blue, and alpha components
  38.      are used to generate s, t, r, and q texture coordinates, respectively. If
  39.      a valid texture has been defined, and texture-mapping enabled, these
  40.      texture coordinates will produce, in effect, a function of the color
  41.      components, which can then be blended with the original color components,
  42.      according to the texture environment blend function.
  43.  
  44.      Alternatively, this mode command can be used to replace the fragment
  45.      color with the current raster position's color values. For example,
  46.      calling ggggllllPPPPiiiixxxxeeeellllTTTTeeeexxxxGGGGeeeennnnSSSSGGGGIIIIXXXX with GGGGLLLL____AAAALLLLPPPPHHHHAAAA will cause the fragment alpha to
  47.      be the alpha of the current raster position.
  48.  
  49.      A useful mode of pixel texture is to have a pixel group with the external
  50.      format GGGGLLLL____RRRRGGGGBBBBAAAA index into a 3D texture, and have the alpha component
  51.      combined with the texel output. In this case the internal format of the
  52.      texture must have alpha, and that alpha can be replaced by the "incoming"
  53.      alpha by calling ggggllllPPPPiiiixxxxeeeellllTTTTeeeexxxxGGGGeeeennnnSSSSGGGGIIIIXXXX with the parameter
  54.      GGGGLLLL____PPPPIIIIXXXXEEEELLLL____TTTTEEEEXXXX____GGGGEEEENNNN____AAAALLLLPPPPHHHHAAAA____RRRREEEEPPPPLLLLAAAACCCCEEEE____SSSSGGGGIIIIXXXX. The "alpha replace" mode can be
  55.      turned off by calling ggggllllPPPPiiiixxxxeeeellllTTTTeeeexxxxGGGGeeeennnnSSSSGGGGIIIIXXXX with the parameter
  56.      GGGGLLLL____PPPPIIIIXXXXEEEELLLL____TTTTEEEEXXXX____GGGGEEEENNNN____AAAALLLLPPPPHHHHAAAA____NNNNOOOO____RRRREEEEPPPPLLLLAAAACCCCEEEE____SSSSGGGGIIIIXXXX, the default.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ggggllllPPPPiiiixxxxeeeellllTTTTeeeexxxxGGGGeeeennnnSSSSGGGGIIIIXXXX((((3333GGGG))))          OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee          ggggllllPPPPiiiixxxxeeeellllTTTTeeeexxxxGGGGeeeennnnSSSSGGGGIIIIXXXX((((3333GGGG))))
  71.  
  72.  
  73.  
  74.      Currently Silicon Graphics machines that support ggggllllPPPPiiiixxxxeeeellllTTTTeeeexxxxGGGGeeeennnnSSSSGGGGIIIIXXXX in
  75.      hardware do not have quad-linear interpolation. So the fourth dimension
  76.      of interpolation, q, defaults to nearest-neighbor mode (the other
  77.      dimensions may still be linear, depending on the ggggllllTTTTeeeexxxxPPPPaaaarrrraaaammmmeeeetttteeeerrrr call).
  78.  
  79.      In order to achieve a true quad-linearly interpolated result, a two-pass
  80.      operation is required, which uses the frame buffer blend for the last
  81.      interpolation. For this purpose special ceiling/floor functions for the q
  82.      dimension have been supplied, which can be referenced in the man pages
  83.      for ggggllllTTTTeeeexxxxPPPPaaaarrrraaaammmmeeeetttteeeerrrr. These are
  84.  
  85.      GGGGLLLL____PPPPIIIIXXXXEEEELLLL____TTTTEEEEXXXX____GGGGEEEENNNN____QQQQ____CCCCEEEEIIIILLLLIIIINNNNGGGG____SSSSGGGGIIIIXXXX
  86.  
  87.      GGGGLLLL____PPPPIIIIXXXXEEEELLLL____TTTTEEEEXXXX____GGGGEEEENNNN____QQQQ____FFFFLLLLOOOOOOOORRRR____SSSSGGGGIIIIXXXX
  88.  
  89.      GGGGLLLL____PPPPIIIIXXXXEEEELLLL____TTTTEEEEXXXX____GGGGEEEENNNN____QQQQ____RRRROOOOUUUUNNNNDDDD____SSSSGGGGIIIIXXXX
  90.  
  91.      On the second pass, use the "alpha replace" mode (described above) to
  92.      combine the incoming alpha with the output (as well as using it in the
  93.      fourth dimensional texture lookup). The original alpha, however, is not
  94.      usable as a fractional interpolation value until it gets left-shifted by
  95.      the number of bits corresponding to the logarithm (base 2) of the q size
  96.      of 4D texture. The alpha can be effectively left-shifted using the
  97.      texture color table. Since the table has limited precision, a mode is
  98.      supplied which will left-shift the alpha by 4 bits before combining it
  99.      with the output. To use it call ggggllllPPPPiiiixxxxeeeellllTTTTeeeexxxxGGGGeeeennnnSSSSGGGGIIIIXXXX with the parameter
  100.      GGGGLLLL____PPPPIIIIXXXXEEEELLLL____TTTTEEEEXXXX____GGGGEEEENNNN____AAAALLLLPPPPHHHHAAAA____LLLLSSSS____SSSSGGGGIIIIXXXX. The default, with no left shift, is
  101.      GGGGLLLL____PPPPIIIIXXXXEEEELLLL____TTTTEEEEXXXX____GGGGEEEENNNN____AAAALLLLPPPPHHHHAAAA____MMMMSSSS____SSSSGGGGIIIIXXXX (MS and LS refer to "most significant" and
  102.      "least significant"). This produces excellent results for 8 and 12 bit
  103.      components, for different texture q sizes.
  104.  
  105.  
  106.  
  107. EEEERRRRRRRROOOORRRRSSSS
  108.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____EEEENNNNUUUUMMMM is generated when _m_o_d_e is not an accepted defined value.
  109.  
  110. MMMMAAAACCCCHHHHIIIINNNNEEEE DDDDEEEEPPPPEEEENNNNDDDDEEEENNNNCCCCIIIIEEEESSSS
  111.      ggggllllPPPPiiiixxxxeeeellllTTTTeeeexxxxGGGGeeeennnnSSSSGGGGIIIIXXXX is supported only on HHHHiiiigggghhhh IIIImmmmppppaaaacccctttt and MMMMaaaaxxxxiiiimmmmuuuummmm IIIImmmmppppaaaacccctttt
  112.      systems; however, only 3D and 4D textures can be used.
  113.  
  114.      On HHHHiiiigggghhhh IIIImmmmppppaaaacccctttt and MMMMaaaaxxxxiiiimmmmuuuummmm IIIImmmmppppaaaacccctttt systems, the effect of the current
  115.      raster position's color is not taken into account, as if the color is
  116.      white, with full alpha.  Also, the default and only supported mode is
  117.      GGGGLLLL____RRRRGGGGBBBBAAAA, meaning that the fragment color is limited to this constant
  118.      color. Additional functionality is provided in the
  119.      SSSSGGGGIIIIXXXX____iiiimmmmppppaaaacccctttt____ppppiiiixxxxeeeellll____tttteeeexxxxttttuuuurrrreeee extension on HHHHiiiigggghhhh IIIImmmmppppaaaacccctttt and MMMMaaaaxxxxiiiimmmmuuuummmm IIIImmmmppppaaaacccctttt
  120.      systems.
  121.  
  122.      On HHHHiiiigggghhhh IIIImmmmppppaaaacccctttt and MMMMaaaaxxxxiiiimmmmuuuummmm IIIImmmmppppaaaacccctttt systems, ggggllllPPPPiiiixxxxeeeellllTTTTeeeexxxxGGGGeeeennnnSSSSGGGGIIIIXXXX for
  123.      ggggllllCCCCooooppppyyyyPPPPiiiixxxxeeeellllssss is not supported.
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. ggggllllPPPPiiiixxxxeeeellllTTTTeeeexxxxGGGGeeeennnnSSSSGGGGIIIIXXXX((((3333GGGG))))          OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee          ggggllllPPPPiiiixxxxeeeellllTTTTeeeexxxxGGGGeeeennnnSSSSGGGGIIIIXXXX((((3333GGGG))))
  137.  
  138.  
  139.  
  140. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  141.      ggggllllTTTTeeeexxxxEEEEnnnnvvvv, ggggllllTTTTeeeexxxxIIIImmmmaaaaggggeeee1111DDDD, ggggllllTTTTeeeexxxxIIIImmmmaaaaggggeeee2222DDDD, ggggllllTTTTeeeexxxxIIIImmmmaaaaggggeeee3333DDDDEEEEXXXXTTTT, ggggllllTTTTeeeexxxxIIIImmmmaaaaggggeeee4444DDDDSSSSGGGGIIIISSSS,
  142.      ggggllllTTTTeeeexxxxPPPPaaaarrrraaaammmmeeeetttteeeerrrr
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.